<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DeepTime.Controls">


    <Style TargetType="local:FlowDateSelector">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:FlowDateSelector">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Canvas Grid.Row="0" x:Name="PART_YearsViewPort" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                                <ItemsControl x:Name="PART_YearsItems">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Border BorderBrush="Black" BorderThickness="1">
                                                <TextBlock Text="{Binding Description}" />
                                            </Border>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </ItemsControl>
                            </Canvas>
                            <Canvas Grid.Row="1" x:Name="PART_MonthsViewPort"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                                <ItemsControl x:Name="PART_MonthsItems">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Border BorderBrush="Black" BorderThickness="1">
                                                <TextBlock Text="{Binding Description}" />
                                            </Border>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </ItemsControl>
                            </Canvas>
                            <Canvas Grid.Row="2" x:Name="PART_DaysViewPort" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                                <ItemsControl x:Name="PART_DaysItems">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Border BorderBrush="Black" BorderThickness="1">
                                                <TextBlock Text="{Binding Description}" />
                                            </Border>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </ItemsControl>
                            </Canvas>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
